package gui.commands;

import model.entity.Product;
import model.entity.container.ProductContainer;
import model.management.ProductManager;
import common.Result;

public class AddProductCommand implements Command
{
  private final Product          product;
  private final ProductContainer container;

  public AddProductCommand(Product product, ProductContainer container)
  {
    this.product = product;
    this.container = container;
  }

  @Override
  public Result reverse()
  {
    return ProductManager.removeProductFromContainer(product, container);
  }

  @Override
  public Result execute()
  {
    return ProductManager.addProduct(product);
  }
}
